/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Minh Luc
 */
@Entity
@Table(name = "Rss", catalog = "P2PDB", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Rss.findAll", query = "SELECT r FROM Rss r"),
    @NamedQuery(name = "Rss.findByRssId", query = "SELECT r FROM Rss r WHERE r.rssId = :rssId"),
    @NamedQuery(name = "Rss.findByRssDesciption", query = "SELECT r FROM Rss r WHERE r.rssDesciption = :rssDesciption"),
    @NamedQuery(name = "Rss.findByRssLink", query = "SELECT r FROM Rss r WHERE r.rssLink = :rssLink")})
public class Rss implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "RssId", nullable = false)
    private Integer rssId;
    @Column(name = "RssLink", length = 300)
    private String rssLink;
    @Column(name = "RssDesciption")
    private String rssDesciption;
    @JoinColumn(name = "RssUser", referencedColumnName = "UserId")
    @ManyToOne
    private Users users;

    public Rss() {
    }

    public Rss(Integer rssId) {
        this.rssId = rssId;
    }

    public Integer getRssId() {
        return rssId;
    }

    public void setRssId(Integer rssId) {
        this.rssId = rssId;
    }

    public String getRssLink() {
        return rssLink;
    }

    public void setRssLink(String rssLink) {
        this.rssLink = rssLink;
    }

    public String getRssDesciption() {
        return rssDesciption;
    }

    public void setRssDesciption(String rssDesciption) {
        this.rssDesciption = rssDesciption;
    }

    public Users getUsers() {
        return users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (rssId != null ? rssId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Rss)) {
            return false;
        }
        Rss other = (Rss) object;
        if ((this.rssId == null && other.rssId != null) || (this.rssId != null && !this.rssId.equals(other.rssId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "test1.Rss[rssId=" + rssId + "]";
    }
}
